package cn.edu.scau.cmi.huangjunxi.adapter;

import java.util.ArrayList;
import java.util.List;
import java.util.Vector;

public class Students {
	
	public Vector<Student> students = new Vector<Student>();
	private List<Integer> intlist = new ArrayList();
	protected int length=0;
	
	public void addStudent(String name,int id)
	{
		students.add(new Student(name,id));
		intlist.add(id);
		length++;
	}
	
	public void sortId()
	{
		SortUtil.sortInt(intlist);
		Vector<Student> temp=new Vector<>();
		Student temps=null;
		for(int i=0;i<length;i++)
		{
			for(int j=0;j<length;j++)
			{
				
				if(students.get(j).getId()==intlist.get(i))
				{
					temp.add(students.get(j));
					break;
				}
			}
			
		}
		students=temp;
		return;
	}
}
